***UK***
use "C:\Users\User\Downloads\joint_data_narratives - with codings - for SPSS.dta", clear
keep if countryID==3
*Three-level voting variable ("don't know" = 99; party #7 doesn't exist)
tab UK_votechoice, sort
gen     uk_vote = 1 if UK_votechoice==8   /*ukip*/
replace uk_vote = 2 if UK_votechoice==1   /*cons.*/
replace uk_vote = 2 if UK_votechoice==2   /*grn*/
replace uk_vote = 2 if UK_votechoice==3   /*labor*/
replace uk_vote = 2 if UK_votechoice==4   /*libdem*/
replace uk_vote = 2 if UK_votechoice==5   /*snp*/
replace uk_vote = 2 if UK_votechoice==6   /*Plaid Cymru*/
replace uk_vote = 2 if UK_votechoice==9   /* Ulster Unionists*/
replace uk_vote = 2 if UK_votechoice==10  /*Democratic Unionist*/
replace uk_vote = 2 if UK_votechoice==11  /*Sinn Feinn */
replace uk_vote = 2 if UK_votechoice==12  /* SDLP */
replace uk_vote = 3 if UK_votechoice==13
replace uk_vote = 3 if UK_votechoice==14
replace uk_vote = 3 if UK_votechoice==15
replace uk_vote = 3 if UK_votechoice==99
label define uk_vote1 1 "Populist" 2 "Other Party" 3 "Other Answer"
label values uk_vote uk_vote1
tab uk_vote
* Two-level voting variable
gen populist_vote_uk = .
replace populist_vote_uk = 1 if UK_votechoice==8
replace populist_vote_uk = 0 if UK_votechoice!=8
tab populist_vote_uk

* Two-level voting variable (other answer are dropped)
gen populist_vote_uk1 = .
replace populist_vote_uk1 = 1 if UK_votechoice==8
replace populist_vote_uk1 = 0 if  uk_vote == 2
tab populist_vote_uk1

* Frequency tables for general and specific stories
tab pastEvent_groups, sort
tab general_past, sort
tab futureEvent_groups, sort
tab general_future, sort
tab actor_groups, sort
tab general_actor, sort

* MCA
label define general_past 1 "Economy" 2 "Rights" 3 "Health" 4 "Immigration" ///
5 "Education" 6 "Environment" 7 "Law" 8 "Transportation" 9 "Peace" 11 "Defense" 12 "Science" 13 "Independence" 14 "Inner events" 15 "IR" 16 "Religion" ///
17 "P.assas" 18 "Sport" , replace
label values general_past general_past

label define general_future 1 "Economy" 2 "Rights" 3 "Health" 4 "Immigration" ///
5 "Education" 6 "Environment" 7 " Law" 8 "Transportation" 9 "Peace" 11 "Defense" 12 "Science" 13 "Independence" 14 "Inner events" 15 "IR" 16 "Religion" ///
18 "Sport" , replace
label values general_future general_future

label define general_actor 1 "Political L." 2 "Royals" 3 "Military L." 4 "Artists" ///
6 "Scientists" 7 "Religious" 33 "DK", replace 
label values general_actor general_actor

label define UK_votechoice 1 "Cons." 2 "Green" 3 "Labour" 4 "Lib.Dem" 5 "SNP" 6 "Plaid" 8 "UKIP", replace
label values UK_votechoice UK_votechoice


* Recode some of the independent variables
tab political_discussion
replace political_discussion = . if political_discussion==99
revrs political_discussion
tab revpolitical_discussion
tab leftright
alpha newspaper_consumption newsweb_consumption tvnews_consumption
gen general_news_consumption = (newspaper_consumption + newsweb_consumption + tvnews_consumption)/3
tab general_news_consumption
gen rural = UK_residence
replace rural = 1 if UK_residence==5
replace rural = 0 if UK_residence!=5
tab rural
tab UK_education
replace UK_education = 0 if UK_education==5
replace UK_education = . if UK_education==88
replace UK_education = . if UK_education==99
replace UK_education = . if UK_education==4
tab UK_education
tab UK_income 
replace UK_income = . if UK_income==88
replace UK_income = . if UK_income==99
tab UK_income 
tab UK_social_class 
recode UK_social_class (6=.)
recode UK_social_class (2=1) (3=2) (4=3) (5=4)
replace UK_social_class = . if UK_social_class==88
replace UK_social_class = . if UK_social_class==99
tab UK_social_class, nol
revrs UK_social_class
tab revUK_social_class, nol
gen class=0
replace class =1 if UK_social_class==3
replace class =1 if UK_social_class==4

tab political_interest
replace political_interest=. if political_interest==99
tab political_interest
tab statement8
replace statement8 = . if statement8==99
tab statement8
gen know1 = 1 if UK_polknowledge1==1
replace know1 = 0 if know1==.
gen know2 = 1 if UK_polknowledge2==1
replace know2 = 0 if know2==.
gen political_knowledge = know1+know2


* Coded stories
gen	traditional_past	=	.
replace	traditional_past	=	0	if	pastEvent_groups	==	"WW2"
replace	traditional_past	=	0	if	pastEvent_groups	==	"No answer"
replace	traditional_past	=	0	if	pastEvent_groups	==	"World wars"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Signing the Magna Carta"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Women's rights"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Birth of the NHS"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Many"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The Norman invasion 1066"
replace	traditional_past	=	0	if	pastEvent_groups	==	"WW1"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Industrial revolution"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Churchill's era"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Joining the European Union"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Margaret Thatcher's regime"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Unification of England and Scotland"
replace	traditional_past	=	0	if	pastEvent_groups	==	"War"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Other"
replace	traditional_past	=	1	if	pastEvent_groups	==	"Our queen's coronation"
replace	traditional_past	=	0	if	pastEvent_groups	==	"British empire's existence and fall"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Creation of the welfare state"
replace	traditional_past	=	0	if	pastEvent_groups	==	"English civil war"
replace	traditional_past	=	1	if	pastEvent_groups	==	"Establishment of Church of England"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Napoleonic wars"
replace	traditional_past	=	0	if	pastEvent_groups	==	"2012 olympics"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Coal miners strikes"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Roman occupation"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Falkland war"
replace	traditional_past	=	1	if	pastEvent_groups	==	"The Reformation"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Death of Princess Diana"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Founding of the Labor Party"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Parliamentary democracy"
replace	traditional_past	=	1	if	pastEvent_groups	==	"Queen's celebrations"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Scottish referendum"
replace	traditional_past	=	1	if	pastEvent_groups	==	"Union of the crowns"
replace	traditional_past	=	0	if	pastEvent_groups	==	"1945 Attlee government"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Abolition of slavery"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Enoch Powell's warning speech"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Henry the 8's regime"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Immigration policy"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Remembrance day"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Tax changes"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The British Commonwealth"
replace	traditional_past	=	0	if	pastEvent_groups	==	"War in Iraq"
replace	traditional_past	=	0	if	pastEvent_groups	==	"1966 world cup win"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Cromwell's regicide"
replace	traditional_past	=	1	if	pastEvent_groups	==	"Events related to the Royal Family"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Invasion by foreign tribes"
replace	traditional_past	=	1	if	pastEvent_groups	==	"Royal weddings"
replace	traditional_past	=	1	if	pastEvent_groups	==	"queen victoria reign"
replace	traditional_past	=	0	if	pastEvent_groups	==	"American war of independance"
replace	traditional_past	=	1	if	pastEvent_groups	==	"Becoming a Christian country"
replace	traditional_past	=	1	if	pastEvent_groups	==	"Birth of prince William"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Everything prior the New Labour government"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Hadrian's Wall"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Holocaust"
replace	traditional_past	=	1	if	pastEvent_groups	==	"Keeping our identity"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Modern Britan"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Oliver Cromwell and king Charle"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Opening of the English Channel"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Repeal of the corn laws"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Scotland beating England in 1967"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Scottish Independance"
replace	traditional_past	=	0	if	pastEvent_groups	==	"Secularization of Britain"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The Restoration"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The Spanish Armada"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The burning of London"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The discovery of penicillin"
replace	traditional_past	=	0	if	pastEvent_groups	==	"The loss of Normandy and Aquitaine"
replace	traditional_past	=	0	if	pastEvent_groups	==	"War of the roses"
replace	traditional_past	=	0	if	pastEvent_groups	==	"When Labour opened the flood gates to the tide of"
replace	traditional_past	=	0	if	pastEvent_groups	==	"When houses were affordable"
replace	traditional_past	=	0	if	pastEvent_groups	==	"When my father was released by Lord Mount Batten"
replace	traditional_past	=	0	if	pastEvent_groups	==	"William 1 defeat of Harold"
replace	traditional_past	=	1	if	pastEvent_groups	==	"elizabeth 1 golden age"
							
							
gen	survival_past	=	.				
replace	survival_past	=	1	if	pastEvent_groups	==	"WW2"
replace	survival_past	=	0	if	pastEvent_groups	==	"No answer"
replace	survival_past	=	1	if	pastEvent_groups	==	"World wars"
replace	survival_past	=	0	if	pastEvent_groups	==	"Signing the Magna Carta"
replace	survival_past	=	0	if	pastEvent_groups	==	"Women's rights"
replace	survival_past	=	0	if	pastEvent_groups	==	"Birth of the NHS"
replace	survival_past	=	0	if	pastEvent_groups	==	"Many"
replace	survival_past	=	1	if	pastEvent_groups	==	"The Norman invasion 1066"
replace	survival_past	=	1	if	pastEvent_groups	==	"WW1"
replace	survival_past	=	1	if	pastEvent_groups	==	"Industrial revolution"
replace	survival_past	=	0	if	pastEvent_groups	==	"Churchill's era"
replace	survival_past	=	0	if	pastEvent_groups	==	"Joining the European Union"
replace	survival_past	=	0	if	pastEvent_groups	==	"Margaret Thatcher's regime"
replace	survival_past	=	0	if	pastEvent_groups	==	"Unification of England and Scotland"
replace	survival_past	=	1	if	pastEvent_groups	==	"War"
replace	survival_past	=	0	if	pastEvent_groups	==	"Other"
replace	survival_past	=	0	if	pastEvent_groups	==	"Our queen's coronation"
replace	survival_past	=	0	if	pastEvent_groups	==	"British empire's existence and fall"
replace	survival_past	=	1	if	pastEvent_groups	==	"Creation of the welfare state"
replace	survival_past	=	1	if	pastEvent_groups	==	"English civil war"
replace	survival_past	=	0	if	pastEvent_groups	==	"Establishment of Church of England"
replace	survival_past	=	1	if	pastEvent_groups	==	"Napoleonic wars"
replace	survival_past	=	0	if	pastEvent_groups	==	"2012 olympics"
replace	survival_past	=	1	if	pastEvent_groups	==	"Coal miners strikes"
replace	survival_past	=	1	if	pastEvent_groups	==	"Roman occupation"
replace	survival_past	=	1	if	pastEvent_groups	==	"Falkland war"
replace	survival_past	=	0	if	pastEvent_groups	==	"The Reformation"
replace	survival_past	=	0	if	pastEvent_groups	==	"Death of Princess Diana"
replace	survival_past	=	0	if	pastEvent_groups	==	"Founding of the Labor Party"
replace	survival_past	=	0	if	pastEvent_groups	==	"Parliamentary democracy"
replace	survival_past	=	0	if	pastEvent_groups	==	"Queen's celebrations"
replace	survival_past	=	0	if	pastEvent_groups	==	"Scottish referendum"
replace	survival_past	=	0	if	pastEvent_groups	==	"Union of the crowns"
replace	survival_past	=	0	if	pastEvent_groups	==	"1945 Attlee government"
replace	survival_past	=	0	if	pastEvent_groups	==	"Abolition of slavery"
replace	survival_past	=	0	if	pastEvent_groups	==	"Enoch Powell's warning speech"
replace	survival_past	=	0	if	pastEvent_groups	==	"Henry the 8's regime"
replace	survival_past	=	0	if	pastEvent_groups	==	"Immigration policy"
replace	survival_past	=	0	if	pastEvent_groups	==	"Remembrance day"
replace	survival_past	=	1	if	pastEvent_groups	==	"Tax changes"
replace	survival_past	=	0	if	pastEvent_groups	==	"The British Commonwealth"
replace	survival_past	=	1	if	pastEvent_groups	==	"War in Iraq"
replace	survival_past	=	0	if	pastEvent_groups	==	"1966 world cup win"
replace	survival_past	=	0	if	pastEvent_groups	==	"Cromwell's regicide"
replace	survival_past	=	0	if	pastEvent_groups	==	"Events related to the Royal Family"
replace	survival_past	=	1	if	pastEvent_groups	==	"Invasion by foreign tribes"
replace	survival_past	=	0	if	pastEvent_groups	==	"Royal weddings"
replace	survival_past	=	0	if	pastEvent_groups	==	"queen victoria reign"
replace	survival_past	=	1	if	pastEvent_groups	==	"American war of independance"
replace	survival_past	=	0	if	pastEvent_groups	==	"Becoming a Christian country"
replace	survival_past	=	0	if	pastEvent_groups	==	"Birth of prince William"
replace	survival_past	=	0	if	pastEvent_groups	==	"Everything prior the New Labour government"
replace	survival_past	=	0	if	pastEvent_groups	==	"Hadrian's Wall"
replace	survival_past	=	0	if	pastEvent_groups	==	"Holocaust"
replace	survival_past	=	0	if	pastEvent_groups	==	"Keeping our identity"
replace	survival_past	=	0	if	pastEvent_groups	==	"Modern Britan"
replace	survival_past	=	0	if	pastEvent_groups	==	"Oliver Cromwell and king Charle"
replace	survival_past	=	0	if	pastEvent_groups	==	"Opening of the English Channel"
replace	survival_past	=	0	if	pastEvent_groups	==	"Repeal of the corn laws"
replace	survival_past	=	1	if	pastEvent_groups	==	"Scotland beating England in 1967"
replace	survival_past	=	0	if	pastEvent_groups	==	"Scottish Independance"
replace	survival_past	=	0	if	pastEvent_groups	==	"Secularization of Britain"
replace	survival_past	=	0	if	pastEvent_groups	==	"The Restoration"
replace	survival_past	=	0	if	pastEvent_groups	==	"The Spanish Armada"
replace	survival_past	=	0	if	pastEvent_groups	==	"The burning of London"
replace	survival_past	=	0	if	pastEvent_groups	==	"The discovery of penicillin"
replace	survival_past	=	0	if	pastEvent_groups	==	"The loss of Normandy and Aquitaine"
replace	survival_past	=	1	if	pastEvent_groups	==	"War of the roses"
replace	survival_past	=	0	if	pastEvent_groups	==	"When Labour opened the flood gates to the tide of"
replace	survival_past	=	1	if	pastEvent_groups	==	"When houses were affordable"
replace	survival_past	=	0	if	pastEvent_groups	==	"When my father was released by Lord Mount Batten"
replace	survival_past	=	1	if	pastEvent_groups	==	"William 1 defeat of Harold"
replace	survival_past	=	0	if	pastEvent_groups	==	"elizabeth 1 golden age"
							
							
gen	self_expression_past	=	.				
replace	self_expression_past	=	0	if	pastEvent_groups	==	"WW2"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"No answer"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"World wars"
replace	self_expression_past	=	1	if	pastEvent_groups	==	"Signing the Magna Carta"
replace	self_expression_past	=	1	if	pastEvent_groups	==	"Women's rights"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Birth of the NHS"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Many"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The Norman invasion 1066"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"WW1"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Industrial revolution"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Churchill's era"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Joining the European Union"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Margaret Thatcher's regime"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Unification of England and Scotland"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"War"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Other"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Our queen's coronation"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"British empire's existence and fall"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Creation of the welfare state"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"English civil war"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Establishment of Church of England"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Napoleonic wars"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"2012 olympics"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Coal miners strikes"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Roman occupation"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Falkland war"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The Reformation"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Death of Princess Diana"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Founding of the Labor Party"
replace	self_expression_past	=	1	if	pastEvent_groups	==	"Parliamentary democracy"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Queen's celebrations"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Scottish referendum"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Union of the crowns"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"1945 Attlee government"
replace	self_expression_past	=	1	if	pastEvent_groups	==	"Abolition of slavery"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Enoch Powell's warning speech"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Henry the 8's regime"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Immigration policy"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Remembrance day"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Tax changes"
replace	self_expression_past	=	1	if	pastEvent_groups	==	"The British Commonwealth"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"War in Iraq"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"1966 world cup win"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Cromwell's regicide"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Events related to the Royal Family"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Invasion by foreign tribes"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Royal weddings"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"queen victoria reign"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"American war of independance"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Becoming a Christian country"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Birth of prince William"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Everything prior the New Labour government"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Hadrian's Wall"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Holocaust"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Keeping our identity"
replace	self_expression_past	=	1	if	pastEvent_groups	==	"Modern Britan"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Oliver Cromwell and king Charle"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Opening of the English Channel"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Repeal of the corn laws"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Scotland beating England in 1967"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"Scottish Independance"
replace	self_expression_past	=	1	if	pastEvent_groups	==	"Secularization of Britain"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The Restoration"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The Spanish Armada"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The burning of London"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The discovery of penicillin"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"The loss of Normandy and Aquitaine"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"War of the roses"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"When Labour opened the flood gates to the tide of"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"When houses were affordable"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"When my father was released by Lord Mount Batten"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"William 1 defeat of Harold"
replace	self_expression_past	=	0	if	pastEvent_groups	==	"elizabeth 1 golden age"
							
							
gen	us_vs_them_past	=	.				
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"WW2"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"No answer"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"World wars"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Signing the Magna Carta"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Women's rights"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Birth of the NHS"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Many"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The Norman invasion 1066"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"WW1"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Industrial revolution"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Churchill's era"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Joining the European Union"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Margaret Thatcher's regime"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Unification of England and Scotland"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"War"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Other"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Our queen's coronation"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"British empire's existence and fall"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Creation of the welfare state"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"English civil war"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Establishment of Church of England"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"Napoleonic wars"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"2012 olympics"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Coal miners strikes"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"Roman occupation"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"Falkland war"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The Reformation"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Death of Princess Diana"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Founding of the Labor Party"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Parliamentary democracy"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Queen's celebrations"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Scottish referendum"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Union of the crowns"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"1945 Attlee government"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Abolition of slavery"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"Enoch Powell's warning speech"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Henry the 8's regime"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"Immigration policy"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Remembrance day"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Tax changes"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The British Commonwealth"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"War in Iraq"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"1966 world cup win"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Cromwell's regicide"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Events related to the Royal Family"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"Invasion by foreign tribes"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Royal weddings"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"queen victoria reign"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"American war of independance"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Becoming a Christian country"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Birth of prince William"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Everything prior the New Labour government"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Hadrian's Wall"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Holocaust"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Keeping our identity"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Modern Britan"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Oliver Cromwell and king Charle"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Opening of the English Channel"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Repeal of the corn laws"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"Scotland beating England in 1967"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Scottish Independance"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"Secularization of Britain"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The Restoration"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The Spanish Armada"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The burning of London"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The discovery of penicillin"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"The loss of Normandy and Aquitaine"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"War of the roses"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"When Labour opened the flood gates to the tide of"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"When houses were affordable"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"When my father was released by Lord Mount Batten"
replace	us_vs_them_past	=	1	if	pastEvent_groups	==	"William 1 defeat of Harold"
replace	us_vs_them_past	=	0	if	pastEvent_groups	==	"elizabeth 1 golden age"
							
							
gen	us_and_them_past	=	.				
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"WW2"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"No answer"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"World wars"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Signing the Magna Carta"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Women's rights"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Birth of the NHS"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Many"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The Norman invasion 1066"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"WW1"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Industrial revolution"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Churchill's era"
replace	us_and_them_past	=	1	if	pastEvent_groups	==	"Joining the European Union"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Margaret Thatcher's regime"
replace	us_and_them_past	=	1	if	pastEvent_groups	==	"Unification of England and Scotland"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"War"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Other"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Our queen's coronation"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"British empire's existence and fall"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Creation of the welfare state"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"English civil war"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Establishment of Church of England"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Napoleonic wars"
replace	us_and_them_past	=	1	if	pastEvent_groups	==	"2012 olympics"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Coal miners strikes"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Roman occupation"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Falkland war"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The Reformation"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Death of Princess Diana"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Founding of the Labor Party"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Parliamentary democracy"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Queen's celebrations"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Scottish referendum"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Union of the crowns"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"1945 Attlee government"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Abolition of slavery"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Enoch Powell's warning speech"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Henry the 8's regime"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Immigration policy"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Remembrance day"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Tax changes"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The British Commonwealth"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"War in Iraq"
replace	us_and_them_past	=	1	if	pastEvent_groups	==	"1966 world cup win"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Cromwell's regicide"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Events related to the Royal Family"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Invasion by foreign tribes"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Royal weddings"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"queen victoria reign"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"American war of independance"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Becoming a Christian country"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Birth of prince William"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Everything prior the New Labour government"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Hadrian's Wall"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Holocaust"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Keeping our identity"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Modern Britan"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Oliver Cromwell and king Charle"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Opening of the English Channel"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Repeal of the corn laws"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Scotland beating England in 1967"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Scottish Independance"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"Secularization of Britain"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The Restoration"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The Spanish Armada"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The burning of London"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The discovery of penicillin"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"The loss of Normandy and Aquitaine"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"War of the roses"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"When Labour opened the flood gates to the tide of"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"When houses were affordable"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"When my father was released by Lord Mount Batten"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"William 1 defeat of Harold"
replace	us_and_them_past	=	0	if	pastEvent_groups	==	"elizabeth 1 golden age"




gen	traditional_future	=	.
replace	traditional_future	=	0	if	futureEvent_groups	==	"No answer"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Exiting the EU"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Immigration policy"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Strong economy"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Equality"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Optimistic future"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Good NHS"
replace	traditional_future	=	0	if	futureEvent_groups	==	"job opportunities"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Fair wage"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Remaining in the EU"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Peace"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Scottish independence"
replace	traditional_future	=	0	if	futureEvent_groups	==	"A fairer society"
replace	traditional_future	=	1	if	futureEvent_groups	==	"Conservative government"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Fair welfare system"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Pessimistic future"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Reducing the power of the EU"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Changing the political structure"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Labor government"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Dealing with terrorism"
replace	traditional_future	=	1	if	futureEvent_groups	==	"End/preserve the monarchy"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Good education for all"
replace	traditional_future	=	0	if	futureEvent_groups	==	"One nation together"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Other"
replace	traditional_future	=	0	if	futureEvent_groups	==	"End poverty"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Increased quality of life"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Integration"
replace	traditional_future	=	0	if	futureEvent_groups	==	"United UK"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Winning the world cup"
replace	traditional_future	=	0	if	futureEvent_groups	==	"other"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Britain supporting itself and its people"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Change of government"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Strong Britain in the eyes of the world"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Politicians who are attentive to citizens"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Technological and scientific progress"
replace	traditional_future	=	0	if	futureEvent_groups	==	"The break up of the UK"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Celebrate St George's day"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Environmental Policy"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Affordable housing"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Become a great nation again"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Economic changes"
replace	traditional_future	=	0	if	futureEvent_groups	==	"National identity related events"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Nationalize public services"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Poverty"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Prince Charles made King"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Reducing the population"
replace	traditional_future	=	1	if	futureEvent_groups	==	"Return to traditional values"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Tax reform"
replace	traditional_future	=	0	if	futureEvent_groups	==	"The Olympics games again"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Coronation of prince William"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Lowering benefits"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Establishment of unions"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Few job opportunities"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Intrest rate policy"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Parliamentary democracy"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Wiping out of extremism"
replace	traditional_future	=	0	if	futureEvent_groups	==	"A solution to the Muslim problem"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Abandoning nuclear weapons"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Abolition of the royal family"
replace	traditional_future	=	1	if	futureEvent_groups	==	"Christian Country"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Decriminalization of cannabis"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Democracy"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Economic crash"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Efficient politicians"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Enter single currency"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Guy prime minister"
replace	traditional_future	=	0	if	futureEvent_groups	==	"I will be the prime minister"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Less crime"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Lower quality of life"
replace	traditional_future	=	1	if	futureEvent_groups	==	"The birth of the Duke and Duchess of Cambridge's babies"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Those responsible for the economic crisis will bear responsibility"
replace	traditional_future	=	0	if	futureEvent_groups	==	"Workers revolution"
replace	traditional_future	=	1	if	futureEvent_groups	==	"continuation of the royal family"
replace	traditional_future	=	0	if	futureEvent_groups	==	"everybody willing to work"
							
							
gen	survival_future	=	.				
replace	survival_future	=	0	if	futureEvent_groups	==	"No answer"
replace	survival_future	=	0	if	futureEvent_groups	==	"Exiting the EU"
replace	survival_future	=	0	if	futureEvent_groups	==	"Immigration policy"
replace	survival_future	=	1	if	futureEvent_groups	==	"Strong economy"
replace	survival_future	=	0	if	futureEvent_groups	==	"Equality"
replace	survival_future	=	0	if	futureEvent_groups	==	"Optimistic future"
replace	survival_future	=	0	if	futureEvent_groups	==	"Good NHS"
replace	survival_future	=	1	if	futureEvent_groups	==	"job opportunities"
replace	survival_future	=	1	if	futureEvent_groups	==	"Fair wage"
replace	survival_future	=	0	if	futureEvent_groups	==	"Remaining in the EU"
replace	survival_future	=	0	if	futureEvent_groups	==	"Peace"
replace	survival_future	=	0	if	futureEvent_groups	==	"Scottish independence"
replace	survival_future	=	0	if	futureEvent_groups	==	"A fairer society"
replace	survival_future	=	0	if	futureEvent_groups	==	"Conservative government"
replace	survival_future	=	0	if	futureEvent_groups	==	"Fair welfare system"
replace	survival_future	=	0	if	futureEvent_groups	==	"Pessimistic future"
replace	survival_future	=	0	if	futureEvent_groups	==	"Reducing the power of the EU"
replace	survival_future	=	0	if	futureEvent_groups	==	"Changing the political structure"
replace	survival_future	=	0	if	futureEvent_groups	==	"Labor government"
replace	survival_future	=	1	if	futureEvent_groups	==	"Dealing with terrorism"
replace	survival_future	=	0	if	futureEvent_groups	==	"End/preserve the monarchy"
replace	survival_future	=	0	if	futureEvent_groups	==	"Good education for all"
replace	survival_future	=	0	if	futureEvent_groups	==	"One nation together"
replace	survival_future	=	0	if	futureEvent_groups	==	"Other"
replace	survival_future	=	1	if	futureEvent_groups	==	"End poverty"
replace	survival_future	=	0	if	futureEvent_groups	==	"Increased quality of life"
replace	survival_future	=	0	if	futureEvent_groups	==	"Integration"
replace	survival_future	=	0	if	futureEvent_groups	==	"United UK"
replace	survival_future	=	0	if	futureEvent_groups	==	"Winning the world cup"
replace	survival_future	=	0	if	futureEvent_groups	==	"other"
replace	survival_future	=	0	if	futureEvent_groups	==	"Britain supporting itself and its people"
replace	survival_future	=	0	if	futureEvent_groups	==	"Change of government"
replace	survival_future	=	0	if	futureEvent_groups	==	"Strong Britain in the eyes of the world"
replace	survival_future	=	0	if	futureEvent_groups	==	"Politicians who are attentive to citizens"
replace	survival_future	=	0	if	futureEvent_groups	==	"Technological and scientific progress"
replace	survival_future	=	0	if	futureEvent_groups	==	"The break up of the UK"
replace	survival_future	=	0	if	futureEvent_groups	==	"Celebrate St George's day"
replace	survival_future	=	0	if	futureEvent_groups	==	"Environmental Policy"
replace	survival_future	=	1	if	futureEvent_groups	==	"Affordable housing"
replace	survival_future	=	0	if	futureEvent_groups	==	"Become a great nation again"
replace	survival_future	=	1	if	futureEvent_groups	==	"Economic changes"
replace	survival_future	=	0	if	futureEvent_groups	==	"National identity related events"
replace	survival_future	=	0	if	futureEvent_groups	==	"Nationalize public services"
replace	survival_future	=	0	if	futureEvent_groups	==	"Poverty"
replace	survival_future	=	0	if	futureEvent_groups	==	"Prince Charles made King"
replace	survival_future	=	0	if	futureEvent_groups	==	"Reducing the population"
replace	survival_future	=	0	if	futureEvent_groups	==	"Return to traditional values"
replace	survival_future	=	1	if	futureEvent_groups	==	"Tax reform"
replace	survival_future	=	0	if	futureEvent_groups	==	"The Olympics games again"
replace	survival_future	=	0	if	futureEvent_groups	==	"Coronation of prince William"
replace	survival_future	=	0	if	futureEvent_groups	==	"Lowering benefits"
replace	survival_future	=	1	if	futureEvent_groups	==	"Establishment of unions"
replace	survival_future	=	1	if	futureEvent_groups	==	"Few job opportunities"
replace	survival_future	=	1	if	futureEvent_groups	==	"Intrest rate policy"
replace	survival_future	=	0	if	futureEvent_groups	==	"Parliamentary democracy"
replace	survival_future	=	0	if	futureEvent_groups	==	"Wiping out of extremism"
replace	survival_future	=	0	if	futureEvent_groups	==	"A solution to the Muslim problem"
replace	survival_future	=	0	if	futureEvent_groups	==	"Abandoning nuclear weapons"
replace	survival_future	=	0	if	futureEvent_groups	==	"Abolition of the royal family"
replace	survival_future	=	0	if	futureEvent_groups	==	"Christian Country"
replace	survival_future	=	0	if	futureEvent_groups	==	"Decriminalization of cannabis"
replace	survival_future	=	0	if	futureEvent_groups	==	"Democracy"
replace	survival_future	=	1	if	futureEvent_groups	==	"Economic crash"
replace	survival_future	=	0	if	futureEvent_groups	==	"Efficient politicians"
replace	survival_future	=	1	if	futureEvent_groups	==	"Enter single currency"
replace	survival_future	=	0	if	futureEvent_groups	==	"Guy prime minister"
replace	survival_future	=	0	if	futureEvent_groups	==	"I will be the prime minister"
replace	survival_future	=	1	if	futureEvent_groups	==	"Less crime"
replace	survival_future	=	0	if	futureEvent_groups	==	"Lower quality of life"
replace	survival_future	=	0	if	futureEvent_groups	==	"The birth of the Duke and Duchess of Cambridge's babies"
replace	survival_future	=	1	if	futureEvent_groups	==	"Those responsible for the economic crisis will bear responsibility"
replace	survival_future	=	1	if	futureEvent_groups	==	"Workers revolution"
replace	survival_future	=	0	if	futureEvent_groups	==	"continuation of the royal family"
replace	survival_future	=	1	if	futureEvent_groups	==	"everybody willing to work"
							
							
gen	self_expression_future	=	.				
replace	self_expression_future	=	0	if	futureEvent_groups	==	"No answer"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Exiting the EU"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Immigration policy"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Strong economy"
replace	self_expression_future	=	1	if	futureEvent_groups	==	"Equality"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Optimistic future"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Good NHS"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"job opportunities"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Fair wage"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Remaining in the EU"
replace	self_expression_future	=	1	if	futureEvent_groups	==	"Peace"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Scottish independence"
replace	self_expression_future	=	1	if	futureEvent_groups	==	"A fairer society"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Conservative government"
replace	self_expression_future	=	1	if	futureEvent_groups	==	"Fair welfare system"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Pessimistic future"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Reducing the power of the EU"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Changing the political structure"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Labor government"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Dealing with terrorism"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"End/preserve the monarchy"
replace	self_expression_future	=	1	if	futureEvent_groups	==	"Good education for all"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"One nation together"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Other"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"End poverty"
replace	self_expression_future	=	1	if	futureEvent_groups	==	"Increased quality of life"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Integration"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"United UK"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Winning the world cup"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"other"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Britain supporting itself and its people"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Change of government"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Strong Britain in the eyes of the world"
replace	self_expression_future	=	1	if	futureEvent_groups	==	"Politicians who are attentive to citizens"
replace	self_expression_future	=	1	if	futureEvent_groups	==	"Technological and scientific progress"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"The break up of the UK"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Celebrate St George's day"
replace	self_expression_future	=	1	if	futureEvent_groups	==	"Environmental Policy"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Affordable housing"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Become a great nation again"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Economic changes"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"National identity related events"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Nationalize public services"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Poverty"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Prince Charles made King"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Reducing the population"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Return to traditional values"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Tax reform"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"The Olympics games again"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Coronation of prince William"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Lowering benefits"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Establishment of unions"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Few job opportunities"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Intrest rate policy"
replace	self_expression_future	=	1	if	futureEvent_groups	==	"Parliamentary democracy"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Wiping out of extremism"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"A solution to the Muslim problem"
replace	self_expression_future	=	1	if	futureEvent_groups	==	"Abandoning nuclear weapons"
replace	self_expression_future	=	1	if	futureEvent_groups	==	"Abolition of the royal family"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Christian Country"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Decriminalization of cannabis"
replace	self_expression_future	=	1	if	futureEvent_groups	==	"Democracy"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Economic crash"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Efficient politicians"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Enter single currency"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Guy prime minister"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"I will be the prime minister"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Less crime"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Lower quality of life"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"The birth of the Duke and Duchess of Cambridge's babies"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Those responsible for the economic crisis will bear responsibility"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"Workers revolution"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"continuation of the royal family"
replace	self_expression_future	=	0	if	futureEvent_groups	==	"everybody willing to work"
							
							
gen	us_vs_them_future	=	.				
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"No answer"
replace	us_vs_them_future	=	1	if	futureEvent_groups	==	"Exiting the EU"
replace	us_vs_them_future	=	1	if	futureEvent_groups	==	"Immigration policy"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Strong economy"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Equality"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Optimistic future"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Good NHS"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"job opportunities"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Fair wage"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Remaining in the EU"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Peace"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Scottish independence"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"A fairer society"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Conservative government"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Fair welfare system"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Pessimistic future"
replace	us_vs_them_future	=	1	if	futureEvent_groups	==	"Reducing the power of the EU"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Changing the political structure"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Labor government"
replace	us_vs_them_future	=	1	if	futureEvent_groups	==	"Dealing with terrorism"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"End/preserve the monarchy"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Good education for all"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"One nation together"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Other"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"End poverty"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Increased quality of life"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Integration"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"United UK"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Winning the world cup"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"other"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Britain supporting itself and its people"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Change of government"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Strong Britain in the eyes of the world"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Politicians who are attentive to citizens"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Technological and scientific progress"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"The break up of the UK"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Celebrate St George's day"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Environmental Policy"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Affordable housing"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Become a great nation again"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Economic changes"
replace	us_vs_them_future	=	1	if	futureEvent_groups	==	"National identity related events"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Nationalize public services"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Poverty"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Prince Charles made King"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Reducing the population"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Return to traditional values"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Tax reform"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"The Olympics games again"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Coronation of prince William"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Lowering benefits"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Establishment of unions"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Few job opportunities"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Intrest rate policy"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Parliamentary democracy"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Wiping out of extremism"
replace	us_vs_them_future	=	1	if	futureEvent_groups	==	"A solution to the Muslim problem"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Abandoning nuclear weapons"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Abolition of the royal family"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Christian Country"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Decriminalization of cannabis"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Democracy"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Economic crash"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Efficient politicians"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Enter single currency"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Guy prime minister"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"I will be the prime minister"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Less crime"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Lower quality of life"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"The birth of the Duke and Duchess of Cambridge's babies"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Those responsible for the economic crisis will bear responsibility"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"Workers revolution"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"continuation of the royal family"
replace	us_vs_them_future	=	0	if	futureEvent_groups	==	"everybody willing to work"
							
							
gen	us_and_them_future	=	.				
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"No answer"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Exiting the EU"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Immigration policy"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Strong economy"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Equality"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Optimistic future"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Good NHS"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"job opportunities"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Fair wage"
replace	us_and_them_future	=	1	if	futureEvent_groups	==	"Remaining in the EU"
replace	us_and_them_future	=	1	if	futureEvent_groups	==	"Peace"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Scottish independence"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"A fairer society"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Conservative government"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Fair welfare system"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Pessimistic future"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Reducing the power of the EU"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Changing the political structure"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Labor government"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Dealing with terrorism"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"End/preserve the monarchy"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Good education for all"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"One nation together"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Other"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"End poverty"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Increased quality of life"
replace	us_and_them_future	=	1	if	futureEvent_groups	==	"Integration"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"United UK"
replace	us_and_them_future	=	1	if	futureEvent_groups	==	"Winning the world cup"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"other"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Britain supporting itself and its people"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Change of government"
replace	us_and_them_future	=	1	if	futureEvent_groups	==	"Strong Britain in the eyes of the world"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Politicians who are attentive to citizens"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Technological and scientific progress"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"The break up of the UK"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Celebrate St George's day"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Environmental Policy"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Affordable housing"
replace	us_and_them_future	=	1	if	futureEvent_groups	==	"Become a great nation again"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Economic changes"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"National identity related events"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Nationalize public services"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Poverty"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Prince Charles made King"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Reducing the population"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Return to traditional values"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Tax reform"
replace	us_and_them_future	=	1	if	futureEvent_groups	==	"The Olympics games again"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Coronation of prince William"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Lowering benefits"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Establishment of unions"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Few job opportunities"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Intrest rate policy"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Parliamentary democracy"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Wiping out of extremism"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"A solution to the Muslim problem"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Abandoning nuclear weapons"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Abolition of the royal family"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Christian Country"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Decriminalization of cannabis"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Democracy"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Economic crash"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Efficient politicians"
replace	us_and_them_future	=	1	if	futureEvent_groups	==	"Enter single currency"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Guy prime minister"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"I will be the prime minister"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Less crime"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Lower quality of life"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"The birth of the Duke and Duchess of Cambridge's babies"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Those responsible for the economic crisis will bear responsibility"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"Workers revolution"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"continuation of the royal family"
replace	us_and_them_future	=	0	if	futureEvent_groups	==	"everybody willing to work"

encode pastEvent_groups, generate(pastEvent_groups1)
encode futureEvent_groups, generate(futureEvent_groups1)

gen Storycalsification=.
replace Storycalsification=1 if survival_past==1 | survival_future==1
replace Storycalsification=2 if self_expression_past==1|self_expression_future==1
replace Storycalsification=3 if us_vs_them_past==1|us_vs_them_future==1

label define Storycalsification 1 "survival" 2 "Self-Expression" 3 "us/them", replace 
label values Storycalsification Storycalsification

mca   general_past general_future Storycalsification UK_votechoic if (UK_votechoic==1 | UK_votechoic==3 |UK_votechoic==4 |UK_votechoic==8) &  general_past<20 & general_past!=17 & general_future<20  , dim(3) 
mcaplot, overlay xline(0) yline(0)  mlabpos(12) mlabgap(2) scale(.7) ///
mlabsize(vsmall)   
graph save "Fig 1a", replace

*combined past and future variables
gen traditional1=traditional_past+traditional_future
gen survival=survival_past+survival_future
gen self_expression=self_expression_past+self_expression_future
gen us_vs_them=us_vs_them_past+us_vs_them_future
gen us_and_them=us_and_them_past+us_and_them_future


* Us and them scale
gen us_them_scale=.
replace us_them_scale=-2 if us_vs_them==2 & us_and_them==0
replace us_them_scale=-1 if us_vs_them==1 & us_and_them==0
replace us_them_scale=-1 if us_vs_them==2 & us_and_them==1
replace us_them_scale=1 if us_and_them==1 & us_vs_them==0
replace us_them_scale=1 if us_and_them==2 & us_vs_them==1
replace us_them_scale=2 if us_and_them==2 & us_vs_them==0
replace us_them_scale=0 if  us_vs_them==us_and_them
br us_vs_them  us_and_them  us_them_scale
tab us_them_scale
gen usvsthem=us_them_scale*-1

* Factor analysis of populist perceptions battery
recode statement1 (99=.)
recode statement2 (99=.)
recode statement3 (99=.)
recode statement4 (99=.)
recode statement5 (99=.)
recode statement6 (99=.)
recode statement7 (99=.)
recode statement8 (99=.)

tab1 statement1-statement8
factor statement1-statement8
revrs statement5-statement8
factor statement1-statement4 revstatement5 revstatement6 revstatement7 revstatement8
alpha statement1-statement4 revstatement5 revstatement6 revstatement7 revstatement8
gen populist_attitudes=(statement1+statement2+statement3+statement4+revstatement5+revstatement6+revstatement7+revstatement8)/8
tab populist_attitudes
ttest populist_attitudes, by(populist_vote_uk)

* Party-family variable
gen party_family = . 
replace party_family=1 if UK_votechoice==8
replace party_family=2 if UK_votechoice==1
replace party_family=3 if UK_votechoice==2
replace party_family=3 if UK_votechoice==3
label define party_family1 1 "Populist" 2 "Mainstream Right" 3 "Mainstream Left"
label values party_family party_family1
tab party_family

set scheme plotplain


/*labeling of variables for reg coef.*/
label var usvsthem "Us/them"
label var survival "Survival"
label var self_expression "Self-expression"
label var populist_attitudes "Populist attitudes"
label var gender "Female"
label var political_knowledge "Political knowledge"
label var political_interest "Political interest"
label var leftright "L-R ideology"
label var rural "Rural"
label var UK_education "Education"
label var UK_income "Income"
label var UK_social_class "Class"
label var UK_age "Age"
label var survival_past "Survival - past"
label var us_vs_them_future "Confrontational - future"
label var us_vs_them_past "Confrontational - past"
label var survival_future "Survival - future"
label var self_expression_future "Expressional - future"
label var self_expression_past "Expressional - past"


/*logit*/
logit populist_vote_uk usvsthem survival ///
	self_expression  populist_attitudes  gender  political_interest political_knowledge ///
	leftright  rural UK_education  UK_social_class UK_age 
est sto m1	
coefplot m1, drop(_cons) xline(0) title("UK") levels(95) ciopts(recast(. rcap)) offset(1/6) ///
graphregion(margin(l=65)) yscale(alt noline) coeflabels(, labgap(-130) notick labcolor(black) ) 
graph save "uk coef", replace

/*margins*/
margin, atmeans at(usvsthem= (-2 -1 0 1 2)) /*moving from not having past and future boundary story to having both past and future boundary increases the probabilty to vote rr by 20 percent.*/

/*robustness - without populist attitudes*/
logit populist_vote_uk usvsthem survival ///
	self_expression  gender  political_interest political_knowledge ///
	leftright  rural UK_education  UK_social_class UK_age 
est sto m1	
coefplot m1, drop(_cons) xline(0) title("UK") levels(95) ciopts(recast(. rcap)) offset(1/6) ///
graphregion(margin(l=65)) yscale(alt noline) coeflabels(, labgap(-130) notick labcolor(black) ) 
graph save "uk coef without populist", replace


/*mlogit*/
mlogit party_family usvsthem survival ///
	self_expression  populist_attitudes  gender  political_interest political_knowledge ///
	leftright  rural UK_education  UK_social_class UK_age , base(2)
est sto m1	
esttab  m1  using Table.rtf ///
, cells(b(star fmt(2)) se(par fmt(2))) nogaps stat(pr2 N) ///
 title("Support for the radical right (Multinomal Model, UK)") 



/*diperssion of populist story components in society*/
catplot us_vs_them_future party_family , percent(party_family) stack asyvars title("UK")
graph save "usthem_UK"

grc1leg  "C:\Users\user\Desktop\narraives and populim\USTHEM_NL.gph" "C:\Users\user\Desktop\narraives and populim\usthem_US.gph" "C:\Users\user\Desktop\narraives and populim\usthem_DK.gph" "C:\Users\user\Desktop\narraives and populim\usthem_UK.gph", legendfrom( "C:\Users\user\Desktop\narraives and populim\USTHEM_NL.gph" )

interflex populist_vote_uk usvsthem revUK_social_class survival ///
	self_expression  populist_attitudes  gender  political_interest ///
	leftright  rural UK_education  UK_age ,  type(kernel)  ///
dlabel("Us/them") xlabel("Social class") title("UK") 
graph save "social class_uk"

interflex populist_vote_uk usvsthem UK_education  survival ///
	self_expression  populist_attitudes  gender  political_interest ///
	leftright  rural  UK_age ,  type(kernel)  ///
dlabel("Us/them") xlabel("Education") title("UK") 
graph save "education_uk"

interflex populist_vote_uk usvsthem UK_residence UK_education  survival ///
	self_expression  populist_attitudes  gender  political_interest ///
	leftright    UK_age if  UK_residence!=1,  type(kernel)  ///
dlabel("Us/them") xlabel("Urban/Rural divide") title("UK") 
graph save "rural_uk"

grc1leg  "C:\Users\odelia\Downloads\class_uk.gph" "C:\Users\odelia\Downloads\education_uk.gph" "C:\Users\odelia\Downloads\education_dk.gph" "C:\Users\odelia\Downloads\social class_dk.gph" "C:\Users\odelia\Downloads\education_nl.gph" "C:\Users\odelia\Documents\knowledge_nl.gph" "C:\Users\odelia\Documents\rural_us.gph" "C:\Users\odelia\Downloads\class_us.gph", col(4) ycommon

log close